<template>
<h1>El-单选组件</h1>
<!--  需要给单选双向绑定变量,用来提交本单选组的最终提交值-->
  <el-radio-group v-model="edu">
<!--    value控制当前选项被选中时提交的值-->
    <el-radio value="1" label="初中"></el-radio>
    <el-radio value="2" label="高中"></el-radio>
    <el-radio value="3" label="本科"></el-radio>
    <el-radio value="4" label="硕士"></el-radio>
  </el-radio-group>
  <h4>您选择的学历是:{{edu}}</h4>
  <hr>
  <el-radio-group v-model="pr">
    <el-radio-button v-for="p in arr" :value="p.price">{{p.title}}</el-radio-button>
  </el-radio-group>
  <h4>这款酒的价格是:{{pr}}</h4>
</template>


<script setup>
import {ref} from "vue";

const edu = ref('');

const pr = ref(2500);
const arr = ref([
  {title:'五粮液',price:500},
  {title:'茅台',price:2500},
  {title:'汾酒',price:330},
  {title:'梦之蓝',price:368}
]);

</script>

<style scoped>

</style>